<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chat Tool</title>
    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
    <div id="chat-container">
        <!-- 侧边栏 -->
        <div id="sidebar">
            <!-- 添加好友栏 -->
            <div id="add-friend">
                <input type="text" id="friendname" placeholder="请输入好友用户名,回车添加">
            </div>
            <!-- 好友列表容器：滚动区域 -->
            <div id="contact-list-container">
                <div class="contact-list">
                    {{range .Friends}}
                        <div class="contact">
                            <div class="contact-name">{{.}}</div>
                            <div class="contact-msg"></div>
                            <div class="contact-time"></div>
                        </div>
                    {{end}}
                </div>
            </div>
            <!-- 固定在底部的退出按钮 -->
            <div id="sidebar-footer">
                <a href="/logout" id="logout-btn" class="logout-btn">退出</a>
            </div>
        </div>
        
        <!-- 主聊天窗口 -->
        <div id="chat-window">
            <div id="chat-header">
                <div id="chat-name">
                    {{if .ChatPartner}}{{.ChatPartner}}{{else}}聊天界面{{end}}
                </div>
            </div>
            <div id="messages">
                <!-- 消息显示区域 -->
            </div>
            <div id="message-input">
                <textarea id="message-text" placeholder="请输入消息..."></textarea>
                <button id="send-btn">发送</button>
            </div>
        </div>
    </div>
    
    <script src="js/app.js"></script>
    <script src="js/autoResize.js"></script>
</body>
</html>
